extends Node

const NM_LOGIN = "NM_LOGIN"
const NM_GET_ROOMLIST = "NM_GET_ROOMLIST"
const NM_CREATEROOM = "NM_CREATEROOM"
const NM_JOINROOM = "NM_JOINROOM"
const NM_LEAVEROOM = "NM_LEAVEROOM"
const NM_GET_ROOMINFO = "NM_GET_ROOMINFO"
const NM_LOGOUT = "NM_LOGOUT"
const NM_READY = "NM_READY"
const NM_CANCEL_READY = "NM_CANCEL_READY"
const NM_START_GAME = "NM_START_GAME"
const NM_SEND_UPDATE_VIEW = "NM_SEND_UPDATE_VIEW"
const NM_USER_GAME_END = "NM_USER_GAME_END"
const NM_UPLOAD_SCORE = "NM_UPLOAD_SCORE"
const NM_GET_RANK_INFO = "NM_GET_RANK_INFO"
const NM_SCORE_CHANGED = "NM_SCORE_CHANGED"


func getCurrentRoomInfo():
	var data = {
		"roomId": Global.currentRoom["roomId"]
	}
	NetClient.sendMessage(NetMessages.NM_GET_ROOMINFO, data)
	

func sendUserGameEnd():
	var data = {}
	NetClient.sendMessage(NetMessages.NM_USER_GAME_END, data)


func uploadScore():
	var data = {
		"score": Global.score
	}
	NetClient.sendMessage(NetMessages.NM_UPLOAD_SCORE, data)
	

func getRankData():
	var data = {}
	NetClient.sendMessage(NetMessages.NM_GET_RANK_INFO, data)


func userLogin(userName):
	var data = {
		"userName": userName
	}
	NetClient.sendMessage(NetMessages.NM_LOGIN, data)
	
	
func sendScoreChanged():
	var data = {
		"score": Global.score
	}
	NetClient.sendMessage(NetMessages.NM_SCORE_CHANGED, data)
